/**
 * <copyright>
 * </copyright>
 *

 */
package de.rwth.adroidGuiLang.impl;

import de.rwth.adroidGuiLang.AdroidGuiLangPackage;
import de.rwth.adroidGuiLang.Image;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Image</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.rwth.adroidGuiLang.impl.ImageImpl#getFilenameWithoutExtension <em>Filename Without Extension</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ImageImpl extends GuiElementImpl implements Image
{
  /**
   * The default value of the '{@link #getFilenameWithoutExtension() <em>Filename Without Extension</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFilenameWithoutExtension()
   * @generated
   * @ordered
   */
  protected static final String FILENAME_WITHOUT_EXTENSION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getFilenameWithoutExtension() <em>Filename Without Extension</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFilenameWithoutExtension()
   * @generated
   * @ordered
   */
  protected String filenameWithoutExtension = FILENAME_WITHOUT_EXTENSION_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ImageImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return AdroidGuiLangPackage.Literals.IMAGE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getFilenameWithoutExtension()
  {
    return filenameWithoutExtension;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFilenameWithoutExtension(String newFilenameWithoutExtension)
  {
    String oldFilenameWithoutExtension = filenameWithoutExtension;
    filenameWithoutExtension = newFilenameWithoutExtension;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AdroidGuiLangPackage.IMAGE__FILENAME_WITHOUT_EXTENSION, oldFilenameWithoutExtension, filenameWithoutExtension));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case AdroidGuiLangPackage.IMAGE__FILENAME_WITHOUT_EXTENSION:
        return getFilenameWithoutExtension();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case AdroidGuiLangPackage.IMAGE__FILENAME_WITHOUT_EXTENSION:
        setFilenameWithoutExtension((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case AdroidGuiLangPackage.IMAGE__FILENAME_WITHOUT_EXTENSION:
        setFilenameWithoutExtension(FILENAME_WITHOUT_EXTENSION_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case AdroidGuiLangPackage.IMAGE__FILENAME_WITHOUT_EXTENSION:
        return FILENAME_WITHOUT_EXTENSION_EDEFAULT == null ? filenameWithoutExtension != null : !FILENAME_WITHOUT_EXTENSION_EDEFAULT.equals(filenameWithoutExtension);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (FilenameWithoutExtension: ");
    result.append(filenameWithoutExtension);
    result.append(')');
    return result.toString();
  }

} //ImageImpl
